from PySide2.QtWidgets import QApplication,QMessageBox
from PySide2.QtUiTools import QUiLoader

class Test:
    def __init__(self):
        # 加载ui文件
        self.ui = QUiLoader().load('test.ui')
        # 绑定按钮事件
        self.ui.pushButton.clicked.connect(self.action)

    def action(self):
        # 简单逻辑
        info = self.ui.lineEdit.text()
        print(info)
        # 弹出框
        QMessageBox.about(self.ui,'提示信息',f'{info}')

app = QApplication([])
test = Test()
test.ui.show()
app.exec_()
